Automated check detection and image cropping

ABSTRACT

A method of locating a check image region within a document image comprising the steps of locating a MICR region of the check and calculating the top of the check relative to the MICR region.

PRIORITY CLAIM

This application claims benefit of U.S. Provisional Application Ser. No.61/087,811 filed Aug. 11, 2008 entitled “Automated Check Detection andImaging Cropping.”

FIELD OF INVENTION

This invention relates to document image processing, and specifically,to automatically detecting and cropping a bank check region of an image.

BACKGROUND OF THE INVENTION

Existing check reader recognition technologies assume that the imagebeing processed is only the image of the check with no extraneousinformation. These technologies typically work with specialized checkscanners and rely heavily upon a mailroom preparation process where thecheck portion of the paper is removed form the rest of the paperdocument. Companies that wish to scan the entire paper document, keepingit intact are currently unable to use these recognition technologies.

A technology is needed to automatically locate the check image withinthe entire paper document and use the resulting check image or itscoordinates with existing check reader recognition technologies. Thiswill enable companies to keep their paper documents intact, thereforebypassing the mailroom preparation process.

SUMMARY OF INVENTION

This invention automatically locates the check image within the entirepaper document image. The check is located in a two step process. Firstthe bottom of the check (MICR region) is identified. Magnetic InkCharacter Recognition (MICR) is a character recognition technologyutilized primarily by the banking industry to facilitate the processingof checks. The process was shown to the American Bankers Association in1956, and employed in the U.S. by 1963 almost universally. On Sep. 12,1961, Stanford Research Institute (now SRI International) was awardedU.S. Pat. No. 3,000,000 for the invention of MICR, the disclosure ofwhich is incorporated herein by reference.

Relative to lower MICR area, the top of the check is then located.Optionally, the resulting area can be used to write out a new image thatwill contain only the check portion of the document. The resulting checkimage can subsequently be used with existing check reader recognitiontechnologies keeping the original paper document intact. Alternatively,the coordinates of the check area can be communicated to the checkrecognition engine.

An embodiment of the invention includes a method of resolving a checkimage region within a document image comprising the steps of processingby optical character recognition (OCR) a full page document imagecontaining rows of text. The OCR is applied using a MICR-specific fontso that non-MICR fonts return a higher level of OCR exceptions than MICRfonts in the document image. The level of OCR exceptions for each row oftext in the document image is calculated using the presumption thatalternate fonts such as Arial or Times New Roman will generate more OCRexceptions since the OCR process is specifically looking for MICR fontcharacters.

The location of the row of text most likely to contain the MICR data isresolved based on the level of OCR exceptions. The lower boundary of thecheck image region is defined by the location of the MICR data.

The next step is that of establishing a check top candidate area. Thecheck top candidate area is defined by a collection of variations inheight of predefined check dimensions measured from the location of theMICR data. Standard checks typically vary in height between 2.5 and 3.5inches. A horizontal raster line is detected within the check topcandidate area whereby the horizontal raster line defines the top of thecheck. Line detection by OCR processing is well known as described inU.S. Pat. No. 4,949,392, the specification of which is incorporatedherein by reference. An upper boundary of the check image region is thusdefined by the location of the horizontal line. Finally, the full pagedocument image is digitally cropped above the upper boundary and belowthe lower boundary to transform the full page document image to acheck-specific image. This check-specific image may be saved to a newimage file.

There may be instances wherein a plurality of horizontal lines existswithin the check top candidate area. In such instances, the upperboundary of the check image region is defined by the location of thehorizontal raster line that is closest to a standard check size. In acondition of uncertainty, the line farthest from the lower boundary isselected. This approach may occasionally lead to a larger cropped imagebut it forgoes the danger of too aggressively cropping out substantiveinformation on the check.

There may also be instances wherein an absence of detectable horizontalraster lines exists. In those instances, the tallest check heightdimension is selected from the collection to define the upper boundary.

An embodiment of the invention is also disclosed in the form of acomputer-readable media having computer-executable instructions forperforming a method of running a software program on a computer. Anexample of such software includes that sold under the brand INIFIWORXmanufactured by AnyDoc Software based in Tampa, Fla. This embodimentincludes one or more computer-readable media having computer-executableinstructions for performing a method of running a software program on acomputer, the computer operating under an operating system, the methodincluding issuing instructions from the software program comprising thesteps of processing by OCR a full page document image containing rows oftext using a MICR-specific font wherein non-MICR fonts return a higherlevel of OCR exceptions than MICR fonts in the document image,calculating the level of OCR exceptions for each row of text in thedocument image, resolving the location of the row of text most likely tocontain the MICR data based on the level of OCR exceptions, defining alower boundary of the check image region by the location of the MICRdata, establishing a check top candidate area, the check top candidatearea defined by a collection of variations in height of predefined checkdimensions measured from the location of the MICR data, detecting ahorizontal raster line within the check top candidate area whereby thehorizontal raster line defines the top of the check, defining an upperboundary of the check image region by the location of the horizontalline and digitally cropping the full page document image above the upperboundary and cropping the full page document image below the lowerboundary to transform the full page document image to a check-specificimage.

It should be understood that this invention may be deployed on a widevariety of operating systems and computer platforms ranging frompersonal computers to mainframe systems. Within the field of documentmanagement, it is well known to batch process a large number of imagesat a time under an automated framework. Full page document images may bescanned prior to implementing this process or may have beencomputer-generated and never existed as hardcopy.

An advantage of the current invention is that MICR data isnear-universal for modern checks and therefore originating checklocations with a universal constant provides, in turn, a universalsolution for check detection that accommodates a wide variety of checkformat diversity.

Another advantage of the current invention is that variable checkheights may be accommodating by detecting a horizontal raster lineassociated with the top of the check. This permits more precise checkcropping thus improve framing and accentuate subject matter forsubsequent analysis, transmission and/or archiving.

BRIEF DESCRIPTION OF THE DRAWINGS

For a fuller understanding of the invention, reference should be made tothe following detailed description, taken in connection with theaccompanying drawings, in which:

FIG. 1 shows a payment stub and check separated by a perforated tearline.

FIG. 2 shows a computer screen display of a digitally imaged check andpayment stub.

FIG. 3 shows a computer screen display of a MICR font-specific OCRprocess applied to the digitally imaged check and payment stub.

FIG. 4 shows a computer screen display illustrating an embodiment of theinvention to determine the location of the top of the check relative tothe MICR region.

FIG. 5 shows a computer screen display illustrating an embodiment of theinvention whereby non-check areas of the digital document image arecropped out.

FIG. 6 shows a computer screen display illustrating an embodiment of theinvention showing the extracted check image as a separate, new imagefile.

FIG. 7 is a diagrammatic illustration of an embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

The fundamental process of the present invention may be encompassed intwo steps. The first step in locating the check image involves findingthe bottom of the check. For this to be done accurately, the MICR linemust be located. To accomplish this, full page OCR is performed on theimage using a MICR only font. MICR has been almost universally adoptedby the banking industry to facilitate the processing of checks. Almostall checks in the United States and United Kingdom include MICRcharacters at the bottom of the paper in a font known as E-13B.

Most of the OCR data returned is erroneous since the image mostlycontains non-MICR information. The resulting OCR results are thenanalyzed to determine which row of text contains the actual MICR data. Avoting algorithm is used that weights the ASCII data row with the mostcharacters and the highest confidence values as returned by the OCRengine.

The second step of the process involves locating the top of the check.This is accomplished by using technology that locates horizontal rasterlines of the image. As with most check documents, many horizontal linesmay be discovered. Since check sizes are standardized (between 2.5 and3.5 inches) the line that relates closest to these standard sizes ischosen with a bias towards the larger check. In such instances, theupper boundary of the check image region is defined by the location ofthe horizontal raster line that is closest to a standard check size. Ina condition of uncertainty, the line farthest from the lower boundary isselected. The reasoning behind this is to preserve the check image incase the wrong line is chosen. In the case where no lines are located,the invention defaults to the larger check size.

Turning to FIG. 1, full page document image 10 is either generatedelectronically or scanned from a hardcopy using an optical scanner.Document image 10 includes check stub 20, check section 30 having a MICRregion 40, and perforation 50 to detach check section 30 from check stub20. In one application of the present invention, thousands of remittancechecks such as those paid by distributors to a manufacturer are receivedand scanned in as a batch process. However, each distributor may use adifferent check style, font and/or layout. The manufacturer wants tostore images of only the check and not the check stub or ancillary data.Additionally, the manufacturer may want to run OCR on the check only ina downstream process to monitor remittances for its billing system. Forall these reasons and more, it is desirable to improve framing,accentuate subject matter and/or change aspect ratio of full pagedocument image 10.

In FIG. 2, computer display 60 shows a visual representation of documentimage 10 for illustrative purposes only. OCR execution button 70 isshown, again, for demonstrative purposes as a commercial embodiment ofthe present invention would include the option to automate the batchprocessing of a plurality of document images without requiring userinteraction. In FIG. 3, each row of text in document image 10 isprocessed by OCR for a MICR font. As shown for illustrative purposes,fourteen (14) rows generated exceptions denoted with an “x.” while thelast row detected a valid MICR font denoted with a check box. TheCartesian coordinates of the last row defines the lower boundary of thecheck. The next step is to determine the upper boundary of the check.

In FIG. 4, MICR text 80 defines lower boundary 90 of the check image.Check top candidate area 100 is defined by a collection of variations inheight of a predefined check dimensions measured from lower boundary 90.Small check size height 110 establishes the lower edge of check topcandidate area 100. Large check size height 120 establishes the upperedge of check top candidate area 100. Within check top candidate area100 exists first horizontal line 130 and second horizontal line 140.Third horizontal line 150 constitutes the lower portion of the checkstub but would be ineligible to define the upper boundary of the checkas it is located outside of check top candidate area 100.

In an embodiment of the invention, the horizontal line most distant fromlower boundary 90 and existing within check top candidate area 100defines an upper boundary of the check image region. This helps mitigatethe possibility that the check image would be too tightly cropped andthus exclude information later required. In this example, secondhorizontal line 140 would define the upper boundary of the check imageregion. In the event that no horizontal line was detected, the upperedge of check top candidate area 100 calculated from large check sizeheight 120 becomes the default upper boundary of the check image region.Horizontal lines are detected by pel pattern techniques as known in theart.

FIG. 5 shows check section 30 extracted from the cropped area above andbelow check section 30. FIG. 6 shows computer display 60 displayingcheck section 30 as a separate image file.

FIG. 7 shows the steps to an embodiment of the invention includingretrieving a full page document image 160 having a check image continuedtherein. The document image is OCR processed 170 for MICR fonts.Non-MICR fonts generate exceptions as they are not well-resolved by theOCR settings. MICR fonts, by contrast, are more easily identified toresolve MICR location 180. Thus, the lower boundary of the check imageregion is defined by the location of the MICR data. Horizontal linedetection 190 is applied to an area above the lower boundary, the areadefined by the various possible check heights expected. Horizontal lineswithin that candidate area are used to resolve the upper boundary of thecheck image region. When a plurality of horizontal lines areencountered, the line most distant from the lower boundary is selected.When no horizontal lines are detected, the largest anticipated checksize is used to define the upper boundary. The check image is digitallycropped 210 from the rest of the document image and a new check imagefile 220 is generated for transmittal, analysis and/or archiving.

It will be seen that the advantages set forth above, and those madeapparent from the foregoing description, are efficiently attained andsince certain changes may be made in the above construction withoutdeparting from the scope of the invention, it is intended that allmatters contained in the foregoing description or shown in theaccompanying drawings shall be interpreted as illustrative and not in alimiting sense.

It is also to be understood that the following claims are intended tocover all of the generic and specific features of the invention hereindescribed, and all statements of the scope of the invention which, as amatter of language, might be said to fall therebetween. Now that theinvention has been described,

What is claimed is:
 1. A method of resolving a check image region withina document image comprising the steps of: processing by (OpticalCharacter Recognition) a full page document image containing rows oftext using a (Magnetic Ink Character Recognition)-specific font whereinnon-MICR fonts return a higher level of OCR exceptions than MICR fontsin the document image; calculating the level of OCR exceptions for eachrow of text in the document image; resolving the location of the row oftext most likely to contain the MICR data based on the level of OCRexceptions; defining a lower boundary of the check image region by thelocation of the MICR data; establishing a check top candidate area, thecheck top candidate area defined by a collection of variations in heightof predefined check dimensions measured from the location of the MICRdata; detecting a horizontal raster line within the check top candidatearea whereby the horizontal raster line defines the top of the check;defining an upper boundary of the check image region by the location ofthe horizontal line; and digitally cropping the full page document imageabove the upper boundary and cropping the full page document image belowthe lower boundary to transform the full page document image to acheck-specific image.
 2. The method of claim 1 further comprising thestep of creating a new image file of the check-specific image.
 3. Themethod of claim 1 wherein the step of defining the upper boundary of thecheck image region comprises locating a horizontal raster line farthestfrom the lower boundary from a plurality of horizontal raster lineswithin the check top candidate area.
 4. The method of claim 1 wherein atallest check height dimension is selected from the collection to definethe upper boundary responsive to the absence of detectable horizontalraster lines.
 5. One or more non-transitory computer-readable mediahaving computer-executable instructions for performing a method ofrunning a software program on a computer, the computer operating underan operating system, the method including issuing instructions from thesoftware program comprising: processing by (Optical CharacterRecognition) a full page document image containing rows of text using a(Magnetic Ink Character Recognition)-specific font wherein non-MICRfonts return a higher level of OCR exceptions than MICR fonts in thedocument image; calculating the level of OCR exceptions for each row oftext in the document image; resolving the location of the row of textmost likely to contain the MICR data based on the level of OCRexceptions; defining a lower boundary of the check image region by thelocation of the MICR data; establishing a check top candidate area, thecheck top candidate area defined by a collection of variations in heightof predefined check dimensions measured from the location of the MICRdata; detecting a horizontal raster line within the check top candidatearea whereby the horizontal raster line defines the top of the check;defining an upper boundary of the check image region by the location ofthe horizontal line; and digitally cropping the full page document imageabove the upper boundary and cropping the full page document image belowthe lower boundary to transform the full page document image to acheck-specific image.
 6. The one or more non-transitorycomputer-readable media of claim 5 further comprising the step ofcreating a new image file of the check-specific image.
 7. The one ormore non-transitory computer-readable media of claim 5 wherein the stepof defining the upper boundary of the check image region compriseslocating a horizontal raster line farthest from the lower boundary froma plurality of horizontal raster lines within the check top candidatearea.
 8. The one or more non-transitory computer-readable media of claim5 wherein a tallest check height dimension is selected from thecollection to define the upper boundary responsive to the absence ofdetectable horizontal raster lines.